package com.server.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;


/**
 * The persistent class for the User database table.
 * 
 */
@Entity
@XmlRootElement
@Table(schema="mhp")
@NamedQueries({@NamedQuery(name="GetUserByID",query="select e from User e where e.userId=:userId"),
	@NamedQuery(name="GetUserByName",query="select e from User e where e.userName=:userName"),
	@NamedQuery(name="GetAllUsers",query="select e from User e")})
public class User implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="userId")
	private String userId;

	private String userName;
		
	@OneToMany(mappedBy="user",cascade={CascadeType.PERSIST,CascadeType.MERGE})
	private List<ItemComment> itemComments;

	@OneToMany(mappedBy="user",cascade={CascadeType.PERSIST,CascadeType.MERGE})
	private List<LoginInfo> loginInfos;
	
	
	public User() {
	}
	
	

	public User(String userId, String userName) {
		super();
		this.userId = userId;
		this.userName = userName;
	}



	public String getUserId() {
		return this.userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

}